Printing apparatus, method of controlling the same, and storage medium

ABSTRACT

A printing apparatus equipped with a direct wireless communication function, and a method of controlling the same, set, in accordance with an instruction of a user, a service to enable in the direct wireless communication function from among a plurality of services including a print service, and control the printing apparatus to execute the direct wireless communication function, applying a port filter corresponding to the service that is set.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to a printing apparatus, a method ofcontrolling the same, and a storage medium.

Description of the Related Art

Printing apparatuses such as multi function peripherals and printers inwhich a wireless LAN function is equipped are increasing in number.Printing apparatuses equipped with the wireless LAN function receiveprinting data from an external apparatus such as a PC or a mobileterminal via an access point and execute print processing based on thereceived printing data. Here, a network to which the printing apparatusis connected is often protected from a security perspective such that aterminal that a network manager did not give permission cannot connect.

Also, there are printing apparatuses that perform direct wirelesscommunication with external apparatuses without going through a relayapparatus such as an access point. In Japanese Patent Laid-Open No.2013-205982, a printing apparatus that performs direct wirelesscommunication with a mobile terminal using Wi-Fi Direct is disclosed.

In the case of such direct wireless communication, a user first selectsa Wi-Fi Direct start button on an operation panel of the printingapparatus to start processing for the direct wireless communication.Then, by the user operating a connection button of the operation panelof the mobile terminal, a connection request is transmitted from themobile terminal to the printing apparatus, and a direct wirelessconnection is established.

In this way, while convenience for the user of the mobile terminal isimproved by the printing apparatus and the mobile terminal performingdirect wireless communication, there is the risk that the printingapparatus will be connected to by a terminal that the network managerhas not permitted since the communication does not go through a relayapparatus. There is the presupposition that the printing apparatus willbe used after being connected to a network in which security isguaranteed. Accordingly, in the case of direct wireless communication,there is the risk that a malicious user will access the printingapparatus wirelessly, and will steal important data from the printingapparatus, or will carry out a cyber-attack on the printing apparatus.

SUMMARY OF THE INVENTION

An aspect of the present invention is to eliminate the above-mentionedproblems which are found in the conventional technology.

A feature of the present invention is to provide a technique forguaranteeing security for a printing apparatus that communicates by adirect wireless communication function.

According to a first aspect of the present invention, there is provideda printing apparatus equipped with a direct wireless communicationfunction, the apparatus comprising: at least one processor; and at leastone memory having instructions stored thereon which, when executed bythe at least one processor, cause the printing apparatus to: set, inaccordance with an instruction of a user, a service to enable in thedirect wireless communication function from among a plurality ofservices including a print service; and control the printing apparatusto execute the direct wireless communication function, applying a portfilter corresponding to the set service, wherein the port filter doesnot affect communication of a wired LAN interface.

According to a second aspect of the present invention, there is provideda printing apparatus, comprising: at least one processor; and at leastone memory having instructions stored thereon which, when executed bythe at least one processor, cause the printing apparatus to: performdirect wireless communication with an external apparatus; set whether ornot to enable a port filter in the direct wireless communication; andcontrol to perform direct wireless communication in accordance with theport filter set for a port used in the direct wireless communicationfunction in a case that the port filter is set to be enabled.

According to a third aspect of the present invention, there is provideda method of controlling a printing apparatus equipped with a directwireless communication function, the method comprising: setting, inaccordance with an instruction of a user, a service to enable in thedirect wireless communication function from among a plurality ofservices including a print service; and controlling the printingapparatus to execute the direct wireless communication function,applying a port filter corresponding to the service that is set, whereinthe port filter does not affect communication of a wired LAN interface.

According to a fourth aspect of the present invention, there is provideda method of controlling a printing apparatus equipped with a directwireless communication function, the method comprising: setting whetheror not to enable a port filter in the direct wireless communication; andcontrolling to perform direct wireless communication in accordance withthe port filter, which is set for a port used in the direct wirelesscommunication function, when the port filter is set to be enabled.

According to a fifth aspect of the present invention, there is provideda non-transitory computer-readable storage medium storing a program forcausing a processor to execute a method of controlling a printingapparatus equipped with a direct wireless communication function, themethod comprising: setting, in accordance with an instruction of a user,a service to enable in the direct wireless communication function fromamong a plurality of services including a print service; and controllingthe printing apparatus to execute the direct wireless communicationfunction, applying a port filter corresponding to the service that isset, wherein the port filter does not affect communication of a wiredLAN interface.

According to a sixth aspect of the present invention, there is provideda non-transitory computer-readable storage medium storing a program forcausing a processor to execute a method of controlling a printingapparatus equipped with a direct wireless communication function, themethod comprising: setting whether or not to enable a port filter in thedirect wireless communication; and controlling to perform directwireless communication in accordance with the port filter, which is setfor a port used in the direct wireless communication function, when theport filter is set to be enabled.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate embodiments of the invention and,together with the description, serve to explain the principles of theinvention.

FIG. 1 depicts a view for describing a configuration of a communicationsystem according to a first embodiment of the present invention.

FIG. 2 is a block diagram for describing a hardware configuration of aprinting apparatus according to the first embodiment.

FIG. 3 is a flowchart for describing control processing when theprinting apparatus according to the first embodiment performs directwireless communication.

FIG. 4 depicts a view illustrating an example of a UI screen which isdisplayed in a console unit of the printing apparatus according to thefirst embodiment, and on which a filter is set with respect to a portfor direct wireless communication.

FIGS. 5A to 5C depict views respectively illustrating examples of UIscreens for causing the printing apparatus according to the firstembodiment to start or stop direct wireless communication.

FIG. 6 depicts a view illustrating an example of a screen which isdisplayed on the console unit of the printing apparatus according to asecond embodiment, and on which services that can be used in a directwireless communication service are set.

FIG. 7 is a flowchart for describing processing in which the printingapparatus according to the second embodiment uses a service by directwireless communication.

FIG. 8 depicts a view illustrating an example of a UI screen which isdisplayed on the console unit of the printing apparatus according to athird embodiment, and on which a filter setting of a port for directwireless communication is performed.

FIG. 9 depicts a view illustrating an example of a filter list screenwhich is displayed on the console unit of the printing apparatusaccording to embodiments, and on which a filter is set with respect to aport for direct wireless communication.

FIG. 10 is a flowchart for describing control processing when theprinting apparatus according to the third embodiment performs directwireless communication.

FIG. 11 depicts a view illustrating an example of a UI screen on whichsettings of filters on port numbers that are used in an interface for alocal area network (LAN), which are set in the printing apparatusaccording to the embodiments, are performed.

DESCRIPTION OF THE EMBODIMENTS

Embodiments of the present invention will be described hereinafter indetail, with reference to the accompanying drawings. It is to beunderstood that the following embodiments are not intended to limit theclaims of the present invention, and that not all of the combinations ofthe aspects that are described according to the following embodimentsare necessarily required with respect to the means to solve the problemsaccording to the present invention.

First Embodiment

FIG. 1 depicts a view for describing a configuration of a communicationsystem according to a first embodiment of the present invention.

A printing apparatus 100 has two or more network interfaces, and mountsa multi-home function wherein these operate in parallel. The printingapparatus 100 is connected to a PC terminal 110 via a wired LAN 101, andhere the printing apparatus 100 uses a wired LAN interface IP address“172. 24. 11. 1”. Also the printing apparatus 100, is equipped with adirect wireless communication function for performing direct wirelesscommunication to a mobile terminal (a communication terminal) 120without going through a relay apparatus such as an access point. In thisdirect wireless communication, the IP address “192. 168. 22. 1” of adirect wireless interface is used. In such a case, the printingapparatus 100 becomes the access point of the wireless communication andreceives a connection request from the mobile terminal 120, and themobile terminal 120 as a client transmits the connection request to theprinting apparatus 100 to establish the direct wireless communication.Also, in FIG. 1, the IP addresses given to the PC terminal 110 and themobile terminal 120 indicate the IP addresses of the printing apparatus100 which the PC terminal 110 and the mobile terminal 120 respectivelyare recognizing.

FIG. 2 is a block diagram for describing a hardware configuration of theprinting apparatus 100 according to the first embodiment. For theprinting apparatus 100 according to the first embodiment, a multifunction peripheral (Multi-Function Peripheral) equipped with a scannerfunction is envisioned, but it may also be a printer that is notequipped with a scanner function.

A CPU 201 controls operation of the printing apparatus 100 bycontrolling each unit connected via a bus 205 by deploying a controlprogram stored in a ROM 203 to a RAM 202 and executing it. The ROM 203stores control programs and various data. The RAM 202 is used as atemporary storage area, such as a work area and a main memory of the CPU201. An HDD 204 stores various data, such as printing data and scannedimages.

Also, in the printing apparatus 100, the single CPU 201 is assumed toperform each process described in flowcharts described later, butanother configuration may be taken. For example, it is possible for aplurality of CPUs to cooperate so as to execute each process illustratedin the flowcharts described later.

A printer 207 is connected to the bus 205 via a printer interface 206,and prints images on sheets (paper) based on printing data received fromthe external apparatus and image data generated by a scanner 209. Thescanner 209 is connected to the bus 205 via a scanner interface 208, andgenerates scanned image data (read image data) by reading an original.The image data generated by the scanner 209 is printed by the printer207, or is stored in the HDD 204.

A console unit 211 is connected to the bus 205 via a console unitinterface 210, and is equipped with a display unit comprising a touchpanel function and a keyboard, and displays each kind of the screendescribed later. A user can input various instructions and informationto the printing apparatus 100 via the console unit 211. A wireless LANchip 215 realizes communication with an external apparatus by wirelessLAN communication, and comprises wireless infrastructure and the directwireless connection types as wireless LAN connection types. A directwireless interface unit 212 performs direct wireless communication withexternal apparatuses such as the mobile terminal 120 via the wirelessLAN chip 215. A wireless infrastructure interface unit 214 performswireless LAN communication with external apparatuses such as an accesspoint via the wireless LAN chip 215. A wired LAN interface unit 213performs communication by the wired LAN via a wired LAN chip 216 withexternal apparatuses such as the PC terminal 110.

Next, the control processing for when the printing apparatus 100performs the direct wireless communication is explained by using theflowchart of FIG. 3.

FIG. 3 is a flowchart for describing control processing when theprinting apparatus 100 according to the first embodiment performs directwireless communication. Also, each step described in this flowchart isrealized by the CPU 201 deploying a control program stored in a memorysuch as the ROM 203 to the RAM 202 and executing it.

Firstly, in step S301 when the CPU 201 determines that a request tostart a direct wireless connection is received from an external terminalsuch as the mobile terminal 120 for example, the processing proceeds tostep S302. In step S302 the CPU 201 determines whether or not a directwireless connection port filter setting that is set in the printingapparatus 100 is enabled. Here whether or not the direct connection portfilter setting is enabled is determined by referencing a value (storedin the RAM 202) set via a UI screen illustrated in FIG. 4, for example.

FIG. 4 depicts a view illustrating an example of a UI screen which isdisplayed on the console unit 211 of the printing apparatus 100according to the first embodiment, and on which a filter is set withrespect to a port for direct wireless connection.

A user selects an “ON” button 401 or an “OFF” button 402 on this screenand then presses an OK button 403. By this, the CPU 201 stores in theRAM 202 a value (ON or OFF) indicating whether to make the filtersetting of a set port enabled or disabled. Here, when the “ON” button401 is selected and the value (ON) is stored, it is determined whetherthe filter setting of the port in the direct wireless communication isenabled. FIG. 4 illustrates a state in which the “ON” button 401 isselected.

In step S302, the processing proceeds to step S304 when it determinesthat the direct wireless connection port filter setting is disabled(OFF), and the CPU 201 causes communication to be allowed from variousport numbers without applying the port filtering function to the directwireless I/F unit 212. Meanwhile, the processing proceeds to step S303when it is determined in step S302 that the direct wireless connectionport filter setting is enabled (ON). In step S303, the CPU 201 applies aport filtering function to the direct wireless I/F unit 212 and executesa filtering operation on a communication port set in advance at a timeof a direct wireless connection. That is, it does not permit directwireless communication via a communication port for which a filter isset. This filter does not act on interfaces other than the directwireless connection interface, and does not affect communication via awired LAN interface for example.

For this reason, the port number for LAN connection illustrated in FIG.11, for example, is not affected by this port filter setting. Also, therestricted communication port is not something that the user can set,but rather is a port number that is set in the printing apparatus 100 inadvance.

As a concrete example, assume that the direct wireless connectioninterface name is “wlan0” and the wired LAN interface name is “eth0”.Here, assumed that as a port filter, a particular port number, forexample “9100” only, is set to “ACCEPT” in relation to communicationdata that is received or transmitted with the interface name “wlan0”. Insuch a case, only data of the port number “9100” is received, and otherdata is discarded. However, with respect to communication data receivedor transmitted on the wired LAN interface “eth0”, filtering processingis not performed even with data other than that of the port number“9100”.

By this, the printing apparatus 100 can be made to not be able totransmit/receive data other than by the permitted port number in a casewhere transmission/reception of data is performed by the direct wirelessconnection interface.

FIGS. 5A to 5C depict views respectively illustrating examples of UIscreens for causing the printing apparatus 100 according to the firstembodiment to start or stop direct wireless communication. These UIscreens are displayed on the console unit 211.

FIG. 5A depicts a view illustrating an example of a default screen, andthe state of direct wireless communication is “STOPPED” and is a statein which a user pressing a start button 501 for instructing to startdirect wireless communication is awaited.

When the user presses the start button 501 in the screen of FIG. 5A,transition is made to the screen illustrated in FIG. 5B. Here, the stateof the direct wireless communication is “WAITING TO RECEIVE CONNECTIONREQUEST” and is a state in which reception of a connection request fromthe mobile terminal 120 is awaited. When the user presses a stop button502 here, the screen of FIG. 5A is returned to.

FIG. 5C depicts a view illustrating an example of a screen of a state inwhich the mobile terminal 120 and the printing apparatus 100 areconnected directly and wirelessly. Here, the state of the directwireless communication is “CONNECTED”. When the user presses a stopbutton 503 or a request to disconnect is received from the mobileterminal 120 in the “CONNECTED” state, the screen illustrated in FIG. 5Ais returned to.

FIG. 11 depicts a view illustrating an example of a UI screen on whichsettings of filters on port numbers that are used in an interface for alocal area network (LAN), which are set in the printing apparatus 100according to the embodiment, are performed.

In the filter setting here, it is possible to make the settingdesignating the port number, send/receive, and TCP/UDP. The user can setthe permission or rejection of send/receive with respect to a particularport number on this filter list setting screen. In FIG. 11, receptionand communication in the protocol “TCP” are set to be prohibited for theport number “9100”, for example. In FIG. 11, it is made to be possibleto set filters with respect to five port numbers, but there may be morethan this. Also, for port numbers, configuration may also be taken suchthat it is possible to designate a range of port numbers such as“10-200” for example.

Also, it is possible to perform setting of a filter with respect to eachport using a UI screen as in later described FIG. 9.

By the first embodiment as described above, it is possible to perform afilter setting with respect to a port number used in direct wirelesscommunication, and to enable or disable this filter setting. By this, itis possible to use only a port of a desired port number to performdirect wireless communication.

Second Embodiment

Next, a second embodiment of the present invention will be described. Inthe second embodiment, an example in which services that can be used indirect wireless communication are defined using port filters in theprinting apparatus 100 is described. Note that since the systemconfiguration and the configurations of the printing apparatus 100, thePC terminal 110, and the mobile terminal 120 according to the secondembodiment are similar to those of the previously described firstembodiment, description thereof is omitted.

FIG. 6 depicts a view illustrating an example of a screen which isdisplayed in the console unit 211 of the printing apparatus 100according to the second embodiment, and on which services that can beused in a direct wireless communication service are set.

The screen includes a service name, and ON and OFF switches by whichthese services are set to be enabled/disabled. For example, in a PRINTservice, it is possible to set a print service to be enabled/disabled inone batch in relation to port numbers of the protocol used in the printfunction, for example “9100”, “515”, and “631”. Also, in a SCAN service,it is possible to set a scan service to enabled/disabled in one batch inrelation to port numbers of the protocol used in the scanner function ofthe printing apparatus 100, for example “67” and “443”. Also, in a SENDservice, it is possible to set a send service to enabled/disabled in onebatch in relation to port numbers used in a file transmission functionof the printing apparatus 100, for example “80” and “443”. Also, in aDISCOVERY service, it is possible to set a discovery service toenabled/disabled in one batch in relation to port numbers of theprotocol used to discover the printing apparatus 100, for example “5353”and “9013”.

In the example of FIG. 6, the print (PRINT) service is set to ON, thescan (SCAN) service is set to OFF, the transmission (SEND) service isset to ON, and the discovery (DISCOVERY) service is set to ON. It ispossible to set each service that can be used in direct wirelesscommunication by pressing the OK button after these settings areperformed.

FIG. 7 is a flowchart for describing processing in which the printingapparatus 100 according to the second embodiment uses a service bydirect wireless communication. Also, each step described in thisflowchart is realized by the CPU 201 deploying a control program storedin a memory such as the ROM 203 to the RAM 202 and executing it. Notethat in FIG. 7, the processing of step S701-step S702 and step S705 isthe same as step S301, step S302, and step S304 of FIG. 3 according tothe previously described first embodiment, and description thereof isomitted.

In step S703, the CPU 201 for each service references settinginformation that is set via the screen of FIG. 6 and stored in the RAM202 and confirms whether or not it is possible to use the respectiveservice in direct wireless communication. Then, the processing proceedsto step S704, the CPU 201 confirms the port number required in theservice that is set so as to be able to be used in direct wirelesscommunication, sets so that wireless communication is possible by onlythe ports of these port numbers, and ends the processing.

By this, the printing apparatus 100 can make it so that it is notpossible to perform communication for a service other than those forwhich it has been permitted when performing direct wirelesscommunication.

By the second embodiment, as described above, the user sets the servicesthat can be used in direct wireless communication, and enables portnumber filter setting in direct wireless communication. By this, it ispossible to exclude direct wireless communication via a port of a portnumber other than those used in the services that can be used.

Third Embodiment

Next, explanation will be given for a third embodiment of the presentinvention. In the third embodiment, an example of port number filtersetting in direct wireless communication in the printing apparatus 100is described. Note that since the system configuration and theconfigurations of the printing apparatus 100, the PC terminal 110, andthe mobile terminal 120 according to the third embodiment are similar tothose of the previously described first embodiment, description thereofis omitted.

FIG. 8 depicts a view illustrating an example of a UI screen which isdisplayed on the console unit 211 of the printing apparatus 100according to the third embodiment, and on which a filter setting of aport for direct wireless communication is performed.

In FIG. 8, there are buttons 801 for designating whether or not to makethe filter setting enabled, and buttons 802 for instructing whether ornot to permit a default filter setting. Setting by the buttons 801 arethe same as the ON and OFF buttons of FIG. 4 of the first embodimentpreviously described.

The default filter setting is stored in, for example, the ROM 203 or theHDD 204. When the ON button of the buttons 801 is selected, the portfilter setting in direct wireless communication is enabled, and when theOFF button is selected, the port filter setting in direct wirelesscommunication is disabled. Also, when “reject” of the buttons 802 isselected, the default filter setting is made to be not employed, andwhen “permit” of the buttons 802 is selected, the default filter settingis employed.

When the ON button in the buttons 801 is selected, it can be selectedwhether to make the later described port filter list to be a permissionlist or a rejection list. Also, for example, wireless communication onall ports is rejected if a port number on which to permit wirelesscommunication is registered when “reject” is selected in the buttons802.

The above described port filter list is a setting dedicated to aninterface for direct wireless communication, and does not affectcommunication of a wired LAN interface, for example.

FIG. 9 depicts a view illustrating an example of a filter list screenwhich is displayed in the console unit 211 of the printing apparatus 100according to the third embodiment, and on which a setting of a port fordirect wireless communication is performed.

In the filter setting here, it is possible to make the settingdesignating the port number, send/receive, and TCP/UDP. The user can setthe permission or rejection of send/receive with respect to a particularport number via this filter list setting screen. In FIG. 9, receptionand communication in the protocol “TCP” are set to be prohibited for theport number “9100”, for example. In FIG. 9, it is made to be possible toset filters with respect to five port numbers, but there may be morethan this. Regarding edit buttons, when corresponding filter settingsare respectively updated, the user can press the edit button and changethe filter setting. Also, configuration may also be taken such that forthe port number, by designating a predetermined range of port numberssuch as “10-200” for example, it is possible to perform the same filtersetting for a plurality of ports corresponding to those port numbers.

FIG. 10 is a flowchart for describing control processing when theprinting apparatus 100 according to the third embodiment performs directwireless communication. Also, each step described in this flowchart isrealized by the CPU 201 deploying a control program stored in a memorysuch as the ROM 203 to the RAM 202 and executing it. Note that in FIG.10, the processing of step S1001, step S1002, and step S1005 is the sameas step S301, step S302, and step S304 of FIG. 3 according to thepreviously described first embodiment, and description thereof isomitted.

In step S1003, the CPU 201 references information stored in the RAM 202that is set via the screen of FIG. 9 to determine whether or not a portnumber is set in a filter list for ports for direct wireless connection.Here, if a port number is set in the filter list, the processingproceeds to step S1004, and the CPU 201 performs port filter processingas in the setting registered in the filter list. That is, it is set sothat it is possible to communicate via only ports of port numbers forwhich communication is permitted that are not registered in the filterlist, and the processing ends. Meanwhile, when, in step S1003, the CPU201 determines that there is no information registered in the filterlist, the processing proceeds to step S1006, port filtering processingis performed in accordance with the setting as to whether or not topermit the default filter setting which is set by any one of the buttons802 of FIG. 8, and the processing ends.

By this, the printing apparatus 100 can be made to not be able tocommunicate via a port other than one of a permitted port number whensend/receive of data is performed via the direct wireless connectioninterface.

By virtue of the third embodiment, as described above, when it isinstructed that filter setting is made to be enabled for a port numberused in direct wireless communication, it is possible to select whetheror not to use the default filter setting when a filter setting has notbe performed. By this, it is possible to perform direct wirelesscommunication using a port of only permitted port numbers if the filtersetting is enabled and the filter setting has not be performed.

Other Embodiments

Embodiments of the present invention can also be realized by a computerof a system or apparatus that reads out and executes computer executableinstructions (e.g., one or more programs) recorded on a storage medium(which may also be referred to more fully as a ‘non-transitorycomputer-readable storage medium’) to perform the functions of one ormore of the above-described embodiment(s) and/or that includes one ormore circuits (e.g., application specific integrated circuit (ASIC)) forperforming the functions of one or more of the above-describedembodiment(s), and by a method performed by the computer of the systemor apparatus by, for example, reading out and executing the computerexecutable instructions from the storage medium to perform the functionsof one or more of the above-described embodiments and/or controlling theone or more circuits to perform the functions of one or more of theabove-described embodiments. The computer may comprise one or moreprocessors (e.g., central processing unit (CPU), micro processing unit(MPU)) and may include a network of separate computers or separateprocessors to read out and execute the computer executable instructions.The computer executable instructions may be provided to the computer,for example, from a network or the storage medium. The storage mediummay include, for example, one or more of a hard disk, a random-accessmemory (RAM), a read only memory (ROM), a storage of distributedcomputing systems, an optical disk (such as a compact disc (CD), digitalversatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, amemory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2016-019251, filed Feb. 3, 2016, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A printing apparatus equipped with a directwireless communication function, the apparatus comprising: at least oneprocessor; and at least one memory having instructions stored thereonwhich, when executed by the at least one processor, cause the printingapparatus to: set, in accordance with an instruction of a user, aservice to enable in the direct wireless communication function fromamong a plurality of services including a print service; and control theprinting apparatus to execute the direct wireless communicationfunction, applying a port filter corresponding to the set service,wherein the port filter does not affect communication of a wired LANinterface.
 2. The printing apparatus according to claim 1, further thememory having instructions which cause the printing apparatus to set, inaccordance with an instruction of a user, whether or not to apply a portfilter to the direct wireless communication function, wherein if it isset to apply the port filter to the direct wireless communicationfunction, the processor controls the printing apparatus to execute thedirect wireless communication function, applying the port filtercorresponding to the set service.
 3. The printing apparatus according toclaim 1, wherein the plurality of services include at least one of theprint service, a scan service, a send service, and a discovery service.4. A printing apparatus, comprising: at least one processor; and atleast one memory having instructions stored thereon which, when executedby the at least one processor, cause the printing apparatus to: performdirect wireless communication with an external apparatus; set whether ornot to enable a port filter in the direct wireless communication; andcontrol to perform direct wireless communication in accordance with theport filter set for a port used in the direct wireless communicationfunction in a case that the port filter is set to be enabled.
 5. Amethod of controlling a printing apparatus equipped with a directwireless communication function, the method comprising: setting, inaccordance with an instruction of a user, a service to enable in thedirect wireless communication function from among a plurality ofservices including a print service; and controlling the printingapparatus to execute the direct wireless communication function,applying a port filter corresponding to the service that is set, whereinthe port filter does not affect communication of a wired LAN interface.6. A method of controlling a printing apparatus equipped with a directwireless communication function, the method comprising: setting whetheror not to enable a port filter in the direct wireless communication; andcontrolling to perform direct wireless communication in accordance withthe port filter, which is set for a port used in the direct wirelesscommunication function, when the port filter is set to be enabled.
 7. Anon-transitory computer-readable storage medium storing a program forcausing a processor to execute a method of controlling a printingapparatus equipped with a direct wireless communication function, themethod comprising: setting, in accordance with an instruction of a user,a service to enable in the direct wireless communication function fromamong a plurality of services including a print service; and controllingthe printing apparatus to execute the direct wireless communicationfunction, applying a port filter corresponding to the service that isset, wherein the port filter does not affect communication of a wiredLAN interface.
 8. A non-transitory computer-readable storage mediumstoring a program for causing a processor to execute a method ofcontrolling a printing apparatus equipped with a direct wirelesscommunication function, the method comprising: setting whether or not toenable a port filter in the direct wireless communication; andcontrolling to perform direct wireless communication in accordance withthe port filter, which is set for a port used in the direct wirelesscommunication function, when the port filter is set to be enabled.